<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <form id="my-form" class="am-form tpl-form-line-form" enctype="multipart/form-data" method="post">
                    <div class="widget-body">
                        <fieldset>
                            <div class="widget-head am-cf">

                                <div class="widget-title am-fl">分销方案一</div>
                            </div>
                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-form-label form-require">
                                    分销条件
                                </label>
                                <div class="am-u-sm-9">
                                    <input type="number" min="0" max="1000000" class="tpl-form-input"
                                           name="distributionSetting[distribution_con]"
                                           value="<?= $data['distribution_con'] ?>" required>
                                    <small>分销条件范围 0 - 1000000,单位：元</small>
                                </div>
                            </div>
                            <div class="am-form-group am-padding-top">
                                <label class="am-u-sm-3 am-form-label form-require"> 分销类型 </label>
                                <div class="am-u-sm-9">
                                    <label class="am-radio-inline">
                                        <input type="radio" name="distributionSetting[distribution_type]"
                                               value="2" data-am-ucheck <?= $data['distribution_type'] == '2' ? 'checked' : '' ?>
                                          >
                                        累加
                                    </label>
                                    <label class="am-radio-inline">
                                        <input type="radio" name="distributionSetting[distribution_type]"
                                               value="1" data-am-ucheck <?= $data['distribution_type'] == '1' ? 'checked' : '' ?>
                                           >
                                        单笔
                                    </label>
                                </div>
                            </div>

                            <div class="am-form-group">
                                <label class="am-u-sm-3 am-form-label form-require">
                                    消费赏金
                                </label>
                                <div class="am-u-sm-9">
                                    <input type="number" min="0" max="100" class="tpl-form-input"
                                           name="distributionSetting[consume_charge]"
                                           value="<?= $data['consume_charge'] ?>" required>
                                    <small>消费赏金佣金比例范围 0% - 100%,单位：%</small>
                                </div>
                            </div>


                            <div class="am-form-group" style="display:none">
                                <div class="am-u-sm-9">
                                    <input type="number" min="0" max="100" class="tpl-form-input"
                                           name="distributionSetting[id]"
                                           value="<?= $data['id'] ?>" required>

                                </div>
                            </div>

                            <div class="am-form-group am-padding-top">
                                <label class="am-u-sm-3 am-form-label form-require"> 商品赏金状态 </label>
                                <div class="am-u-sm-9">
                                    <label class="am-radio-inline">
                                        <input type="radio" name="distributionSetting[product_status]"
                                               value="1" data-am-ucheck <?= $data['product_status'] == '1' ? 'checked' : '' ?>
                                          >
                                        开启
                                    </label>
                                    <label class="am-radio-inline">
                                        <input type="radio" name="distributionSetting[product_status]"
                                               value="2" data-am-ucheck <?= $data['product_status'] == '2' ? 'checked' : '' ?>
                                            >
                                        关闭
                                    </label>
                                    <!--<div class="help-block">
                                        <small>如开启，分销商自己购买商品，获得一级佣金</small>
                                    </div>-->
                                </div>
                            </div>
                            <div class="am-form-group am-padding-top">
                                <label class="am-u-sm-3 am-form-label form-require"> 储值卡赏金状态 </label>
                                <div class="am-u-sm-9">
                                    <label class="am-radio-inline">
                                        <input type="radio" name="distributionSetting[card_status]"
                                               value="1" data-am-ucheck <?= $data['card_status'] == '1' ? 'checked' : '' ?>
                                           >
                                        开启
                                    </label>
                                    <label class="am-radio-inline">
                                        <input type="radio" name="distributionSetting[card_status]"
                                               value="2" data-am-ucheck <?= $data['card_status'] == '2' ? 'checked' : '' ?>
                                           >
                                        关闭
                                    </label>
                                </div>
                            </div>
                            <div class="am-form-group am-padding-top">
                                <label class="am-u-sm-3 am-form-label form-require"> 爆品礼赏金状态 </label>
                                <div class="am-u-sm-9">
                                    <label class="am-radio-inline">
                                        <input type="radio" name="distributionSetting[hot_sale_status]"
                                               value="1" data-am-ucheck <?= $data['hot_sale_status'] == '1' ? 'checked' : '' ?>
                                           >
                                        开启
                                    </label>
                                    <label class="am-radio-inline">
                                        <input type="radio" name="distributionSetting[hot_sale_status]"
                                               value="2" data-am-ucheck <?= $data['hot_sale_status'] == '2' ? 'checked' : '' ?>
                                            >
                                        关闭
                                    </label>
                                </div>
                            </div>
                            <div class="am-form-group am-padding-top">
                                <label class="am-u-sm-3 am-form-label form-require"> 配置状态 </label>
                                <div class="am-u-sm-9">
                                    <label class="am-radio-inline">
                                        <input type="radio" name="distributionSetting[status]"
                                               value="1" data-am-ucheck  <?= $data['status'] == '1' ? 'checked' : '' ?>
                                            >
                                        开启
                                    </label>
                                    <label class="am-radio-inline">
                                        <input type="radio" name="distributionSetting[status]"
                                               value="2" data-am-ucheck <?= $data['status'] == '2' ? 'checked' : '' ?>
                                            >
                                        关闭
                                    </label>
                                </div>
                            </div>


                            <div class="am-form-group am-padding-top">
                                <label class="am-u-sm-3 am-form-label form-require"> 是否使用该方案 </label>
                                <div class="am-u-sm-9">
                                    <label class="am-radio-inline">
                                        <input type="radio" name="dealerCase"
                                               value="1" data-am-ucheck <?= $dealerCase == '1' ? 'checked' : '' ?>
                                        >
                                        是
                                    </label>
                                    <label class="am-radio-inline">
                                        <input type="radio" name="dealerCase"
                                               value="0" data-am-ucheck  <?= $dealerCase != '1' ? 'checked' : '' ?>
                                        >
                                        否
                                    </label>
                                </div>
                            </div>
                            <div class="am-form-group">
                                <div class="am-u-sm-9 am-u-sm-push-3 am-margin-top-lg">
                                    <button type="submit" class="j-submit am-btn am-btn-secondary">提交
                                    </button>
                                </div>
                            </div>
                        </fieldset>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<script src="assets/common/plugins/laydate/laydate.js"></script>
<script src="assets/store/js/select.data.js?v=<?= $version ?>"></script>
<script>
    $(function () {

        // 时间选择器
        laydate.render({
            elem: '.j-laydate-start'
            , type: 'datetime'
        });
        /**
         * 表单验证提交
         * @type {*}
         */
        $('#my-form').superForm();



    });


    function clearNoNum(obj){
        obj.value = obj.value.replace(/[^\d.]/g,"");  //清除“数字”和“.”以外的字符
        obj.value = obj.value.replace(/^\./g,"");  //验证第一个字符是数字而不是.
        obj.value = obj.value.replace(/\.{2,}/g,"."); //只保留第一个. 清除多余的.
        obj.value = obj.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".");
    }
</script>
